package org.example.messagewall.demos.service;

import org.example.messagewall.demos.mapper.MessageMapper;
import org.example.messagewall.demos.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {
    @Autowired
    private MessageMapper messageMapper;

    public void addMessageInfo(MessageInfo message) {
        messageMapper.insertMessage(message);
    }

    public List<MessageInfo> getMessageInfoList() {
        return messageMapper.selectMessage();
    }
}
